class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable, :lockable and :timeoutable
  devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me

  has_many :options, :dependent => :destroy, :autosave => true

  before_create :set_default_options

  protected
  
  #设置默认配置参数
  def set_default_options
    Option.set_default_options(self)
  end

end
